<!-- Features Wrapper -->
<div class="container">
	<h2>Lasted Articles</h2>
</div>

<?php
$CI = & get_instance();
$CI->load->model(array('article_model', 'user_model'));
$CI->load->helper('html2text');
$articles = $CI->article_model->getAllArticle(0, 6);


$i = 0;
foreach ($articles as $value) {
	if ($i % 3 == 0) {
		echo '<!-- ROW ' . $i . ' --> <div id="features-wrapper">
						<div class="container">
							<div class="row">';
	}

	?>

	<!-- Article -->
	<div class="4u">
		<section class="box box-feature">
			<a href="<?php echo base_url() . 'blog/article/' . $value['id'] ?>" style="height: 205px; overflow-y: hidden;"  class="image image-full">
				<img  src="<?php echo base_url() . 'images/article_image/' . $value['image'] ?>" alt=""/></a>

			<div class="inner">
				<header>
					<h2><?php echo $value['title'] ?></h2>
					<h4><?php $user = $CI->user_model->getInfo($value['userid']);
						if(isset($user['name'])) echo $user['name']; ?></h4>
				</header>
				<?php
				$s = convert_html_to_text($value['content']);
				echo substr($s, 0, 100). (strlen($s) > 100 ? ' ...' : '' )?>
			</div>
		</section>
	</div>
	<?php
	if ($i % 3 == 2) echo '<!-- END ROW ' . $i . ' --></div> </div> </div>';
	$i++;

}
if ($i % 3 != 0) echo '<!-- END ROW ' . $i . ' --></div> </div> </div>'?>